package spl.army;

import java.util.Formatter;

/**
 * The class hold information about items when a Mission requires it.
 * Array of this object is stored in every Mission object.
 * @author avikam, ruby
 *
 */
public class ItemRequired {
	private String name;
	private int amount;
	/**
	 * @param nameStr if item
	 * @param nAmount of the item
	 */
	public ItemRequired(String nameStr, int nAmount) {
		this.name = nameStr;
		this.amount = nAmount;
	}
	/**
	 * @return the name
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * @return the amount
	 */
	public int getAmount() {
		return this.amount;
	}
	
	/**
	 * @return string repr
	 */
	public String toString() {
		StringBuilder sb = new StringBuilder();
		Formatter formatter = new Formatter(sb);
		
		return formatter.format("ItemRequired: %s (%d)",
				this.name, this.amount).toString();
	}
}
